import React, {Component} from 'react';

export default (WrappedCMP) => class MyContainer extends Component {
  constructor (props) {
    super(props);
    this.state = {
      value: ''
    };
  }
  componentDidMount () {
    console.log('myContainer did mount');
  }
  fnChange (e) {
    this.setState({value: e.target.value});
  }
  render () {
    let newProps = {
      input: {
        value: this.state.value,
        onChange: this.fnChange.bind(this)
      }
    };
    return (
      <div style={{background: 'orange', padding: 20}}>
        输入框：<WrappedCMP {...this.props} {...newProps}></WrappedCMP>
      </div>
    )
  }
}
